﻿// -----------------------------------------------------------------------
// <copyright file="IRepository.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------



namespace TPTecnicas.MessageProcessor.Common
{
    using System;
    using System.Collections.Generic;
    using System.Linq.Expressions;

    public interface IRepository<T>
    {
        void Add(T entity);

        IEnumerable<T> Where(Expression<Func<T, bool>> predicate);

        IEnumerable<T> Get(Expression<Func<T, bool>> predicate);

        IEnumerable<T> GetAll();

        T First(Expression<Func<T, bool>> predicate);

        T Find(params object[] keyValues);

        void Update(T entity);

        void Delete(T entity);

        void Detach(T entity);

        void Commit();
    }
}
